package com.order.server.config;

import com.order.server.interceptor.FeignServiceNameRequestInterceptor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FeignConfig {

    @Value("${spring.application.name}")
    String serviceName;

    @Bean
    public FeignServiceNameRequestInterceptor requestInterceptor() {
        return new FeignServiceNameRequestInterceptor(serviceName);
    }
}
